package com.home.listener;

import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Component;

/**
 * Created by zhaoqian on 2015/5/5.
 */
@Component("initCustomConfig")
public class InitCustomConfig implements ApplicationListener<ContextRefreshedEvent>{
    @Override
    public void onApplicationEvent(ContextRefreshedEvent  applicationEvent) {
//        if (applicationEvent.getApplicationContext().getParent() == null) {
//            Resource re = new ClassPathResource("/basic.properties");
//            Map map = new HashMap();
//            try {
//                Properties properties = PropertiesLoaderUtils.loadProperties(re);
//                for(Object str:properties.keySet()){
//                    map.put(str,properties.get(str));
//                }
//                Utils.map = map;
//            } catch (IOException e) {
//                e.printStackTrace();
//            }
//        }
    }
}
